package me.leiusual.sharing.util.extension

/**
 * 对象转json字符串
 */
fun Any?.toJson(): String? {
  return try {
    gson.toJson(this)
  } catch (e: Throwable) {
    e.printStackTrace()
    null
  }
}